function add2list(sourceID,targetID){
  source=document.getElementById(sourceID);
  target=document.getElementById(targetID);
  numberOfItems=source.options.length;
  insertPt=target.options.length; // insert at end
  if(target.options[0].text===""){insertPt=0;} // null option fix
  for(i=0;i<numberOfItems;i++){
    if(source.options[i].selected===true){
    msg=source.options[i].text;
    for(j=0;j<target.options.length;j++){
      if(msg===target.options[j].text){j=99;}}
	  if(j<99){    
    	  target.options[insertPt]=new Option(msg);
		  target.options[insertPt].selected=true;
		  target.options[insertPt].value=source.options[i].value;
	      insertPt=target.options.length;}
    }}
}
function takefromlist(targetID){
  target=document.getElementById(targetID);
  if(target.options.length<0){return;}
  for(var i=(target.options.length-1);i>=0;i--){
    if(target.options[i].selected){
      target.options[i]=null;
      if(target.options.length===0){target.options[0]=new Option("");}
    }}
}
function SetCategoria(targetID){	
	target=document.getElementById(targetID);
	indice=target.selectedIndex;
	valor=target.options[indice].value;
	location.href='Admin_main.php?opt=1&categoria='+valor;
	}

/**********************/
/*SendForm			  */
/**********************/
function SendForm(Opcion){
	oFormObject = document.forms['addEntrada'];
	oFormElement = oFormObject.elements["accion"];
	
	if(Opcion=="categorias"){		
		oFormElement.value="categoria";
	}
	
	oFormObject.submit();
}
function SendForm2(Opcion){
	oFormObject = document.forms['checkEntrada'];
	oFormElement = oFormObject.elements["accion"];
	
	if(Opcion=="categorias"){		
		oFormElement.value="categoria";
	}
	
	oFormObject.submit();
}
function SendForm3(Opcion){
	oFormObject = document.forms['setEntrada'];
	oFormElement = oFormObject.elements["accion"];
	
	if(Opcion=="carga"){		
		oFormElement.value="carga";
	}
	if(Opcion=="categorias"){		
		oFormElement.value="categoria";
	}

	oFormObject.submit();
}
